import type { CommentDetail, VisitDetail } from "./models";
import req from "/@/api/req";

export const Api = {
  getEvaluatesPage: "api/iopm/serviceOrderEvaluates/page",
  getCommentDetail: "api/iopm/serviceOrderEvaluates/getServiceOrderEvaluatesByServiceOrderId",
  getOrderVisitDetail: "api/iopm/workOrderVisitRecords/getWorkOrderVisitRecordsByWorkOrderId",
  getComplainVisitDetail: "api/iopm/workOrderComplaints/getWorkComplaintVisitRecordsByComplaintId",
  pageWorkOrderComplaints: "api/iopm/workOrderComplaints/pageWorkOrderComplaints",
};

export function getCommentDetail(id: string) {
  return req.commonPost<CommentDetail>(Api.getCommentDetail, { workOrderId: id });
}

export function getOrderVisitDetail(id: string) {
  return req.commonPost<VisitDetail>(Api.getOrderVisitDetail, { workOrderId: id });
}

export function getComplainVisitDetail(id: string) {
  return req.commonPost<VisitDetail>(Api.getComplainVisitDetail, { workOrderComplaintId: id });
}
